const query = require('../config/db.config.js')

const annouceCtrl = {
  annouce: async (ctx) => {
    let sql = 
    `SELECT an.content ,an.createTime , ad.name 
    FROM announcement an , admin ad 
    WHERE ad.admID = an.admID`
    const res = await query(sql)
    return ctx.body = {
      code: 0,
      msg: 'success',
      data:res[0]
    }
  }
}

module.exports = annouceCtrl